package com.ywl.designpattern.strategy;

/**
 * 2.然后,实现具体的策略类
 * @author yuwl
 * @description 信用卡支付策略
 * @since 2024-06-27 15:58
 */
public class CreditCardStrategy implements PaymentStrategy{
    private String name;
    private String cardNumber;

    public CreditCardStrategy(String name, String cardNumber) {
        this.name = name;
        this.cardNumber = cardNumber;
    }

    @Override
    public void pay(int amount) {
        System.out.println(amount + " paid with credit card");
    }
}
